#include <stdio.h>
#include <math.h>
#include <time.h>
int main()
{
int m,j,a[100],s1=0,max1,min1;
float k,b[100],s2=0,max2,min2,ave;
srand((unsigned)time(NULL));
for(m=1;m<=100;m++)
{
j=rand()%100;
a[m]=j;
s1=s1+j;
k=1.0/j;
b[m]=k;
s2=s2+k;
printf("%d %d %f\n",m,j,k);
}
max1=min1=a[1];
for(m=1;m<=100;m++)
{
if(a[m]>max1)
max1=a[m];
if(a[m]<min1)
min1=a[m];
min2=1.0/max1;
max2=1.0/min1;
}
printf("max %d %f\n",max1,max2);
printf("min %d %f\n",min1,min2);
printf("ave %d %f\n",s1/100,s2/100);
}
